package com.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ssm.mapper.ItemsMapper;
import com.ssm.pojo.Items;
import com.ssm.pojo.ItemsExample;
import com.ssm.pojo.ItemsExample.Criteria;
import com.ssm.pojo.QueryVO;
import com.ssm.service.ItemService;

@Service
@Transactional
public class ItemServiceImpl implements ItemService{
	
	@Autowired
	private ItemsMapper itemsMapper;

	public List<Items> findItem() {
		ItemsExample example = new  ItemsExample();
		List<Items> list = itemsMapper.selectByExampleWithBLOBs(example);
		return list;
	}

	public Items findById(Items queryVO) {
		Items items = itemsMapper.selectByPrimaryKey(queryVO.getId());
		return items;
	}

	public void save(Items item) {
		itemsMapper.updateByPrimaryKeySelective(item);
		
	}

	public List<Items> findByConfitionidOrName(QueryVO queryVO) {
		List<Items> items = itemsMapper.findByConfitionidOrName(queryVO.getItems());
		
		return items;
	}

	
}
